<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt"  uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="${pageContext.request.contextPath }/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/h-ui/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/h-ui/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/h-ui/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/h-ui/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>添加用户</title>
</head>
<body onload="uploadSingleImg('${pageContext.request.contextPath }/upload/upload')">
<div class="pd-20">
  <form action="" method="post" class="form form-horizontal" id="add_HomeMessage_Form">
  	<input type="hidden" id="aId" name="aId" value="${admin.aId }">
  	<div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>展示图片：</label>
      <div class="formControls col-5">  
      	<img id="returnImgShow" alt="" src="${pageContext.request.contextPath }/upload/${admin.aImg }">
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>头像：</label>
      <input type="hidden" id="returnImg" name="aImg" value="${admin.aImg }">
      <div class="formControls col-5">  
	      <div class="uploader-thum-container">    
		      <div id="fileList" class="uploader-list"></div>
		      <div id="filePicker">选择图片</div>
	      </div>
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>姓名：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" value="${admin.aName }" placeholder="" id="aName" name="aName" datatype="*2-12" nullmsg="姓名不能为空">
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>登陆账号：</label>
      <div class="formControls col-5">
      	<span>${admin.aUsername }</span>
        <%-- <input type="text" class="input-text" value="${admin.aUsername }" placeholder="" id="aUsername" name="aUsername" datatype="*2-16" nullmsg="登陆账号不能为空"> --%>
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>电话：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text " value="${admin.aPhone }" placeholder="" id="aPhone" name="aPhone" datatype="m" nullmsg="电话不能为空">
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>性别：</label>
      <div class="formControls col-5">
        <span class="select-box" style="width:150px;">
			<select class="select" id="aSex" name="aSex" size="1" datatype="n" nullmsg="性别不能为空">
				<option value="1" selected="selected">男</option>
				<option value="2">女</option>
			</select>
		</span> 
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>qq：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text " value="${admin.aQq }" minlength="5" maxlength="11" id="aQq" name="aQq" datatype="n5-11" nullmsg="qq不能为空">
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>email：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text " value="${admin.aEmail }" id="aEmail" name="aEmail" datatype="e" nullmsg="email不能为空" errormsg="email地址格式不对">
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red"></span>修改密码：</label>
      <div class="formControls col-5">
      	<a id="updatePasswordButton" onclick="updatePassword()" class="btn btn-primary radius">修改密码</a>
      </div>
    </div>
    <div id="anchor">
	    <div class="row cl">
	      <label class="form-label col-3"><span class="c-red"></span>密码：</label>
	      <div class="formControls col-5">
	        <input type="password" class="input-text " value="aaaaaa"  onkeyup="value=value.replace(/[^A-Z a-z 0-9]/,'')" id="aPassword" name="aPassword" errormsg="密码至少6个字符,最多18个字符！" datatype="*6-18" onkeyup="this.value=this.value.replace(/\s/,'');">
	      </div>
	      <div class="col-4"> </div>
	    </div>
	    <div class="row cl">
	      <label class="form-label col-3"><span class="c-red"></span>确认密码：</label>
	      <div class="formControls col-5">
	      	<!-- 下面的正则表达式是匹配所有的非小写字母，大写字母，数字之外的全部元素，将其替换成空格 -->
	        <input type="password" class="input-text " value="aaaaaa"  onkeyup="value=value.replace(/[^A-Z a-z 0-9]/,'')" id="rePassword" name="rePassword" datatype="*" recheck="aPassword" errormsg="您两次输入的账号密码不一致！" onkeyup="this.value=this.value.replace(/\s/,'');">
	      </div>
	      <div class="col-4"> </div>
	    </div>
    </div>
    <div class="row cl">
      <div class="col-9 col-offset-3">
        <a class="btn btn-primary radius"  onclick="operationdata('../admin/updateAdmin','.form-horizontal')">&nbsp;&nbsp;提交&nbsp;&nbsp;</a>
      </div>
    </div>
  </form>
</div>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/js/H-ui.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/js/H-ui.admin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/webuploader/0.1.5/webuploader.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/uploadSingleImg.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/jqthumb/jqthumb.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/tableBtnGroup.js"></script>
<script type="text/javascript">
	$(function(){
		$('#aSex').val('${admin.aSex }');
		$('#returnImgShow').jqthumb({
	        width: 150,
	        height: 150
	    });
		
		$('#anchor').hide();
	});
	
	function updatePassword(){
		if($('#updatePasswordButton').text()=='修改密码'){
			$('#aPassword').val('');
			$('#rePassword').val('');
			$('#updatePasswordButton').text('放弃修改');
			$('#anchor').show();
		}else if($('#updatePasswordButton').text()=='放弃修改'){
			$('#aPassword').val('aaaaaa');
			$('#rePassword').val('aaaaaa');
			var Validform_error_length=$('#anchor').find('.Validform_error').length;
			$('#anchor').find('.Validform_checktip').html("");
			if(Validform_error_length>0){
				$('#anchor').find('.Validform_error').removeClass('Validform_error');
			}
			var Validform_wrong_length=$('#anchor').find('.Validform_wrong').length;
			if(Validform_wrong_length>0){
				$('#anchor').find('.Validform_wrong').removeClass('Validform_wrong');
			}
			$('#updatePasswordButton').text('修改密码');
			$('#anchor').hide();
		}
	}
</script>
</body>
</html>